<?php
/**
 * 测试专用控制器
 */

namespace app\index\controller;

use app\common\controller\Base;
class Test extends Base
{
    // 测试用户的验证器
    public function test1(){
        $data = [
            'name'=>'aaaaa',
            'email'=>'aaaqqq.com',
            'mobile'=>'189666655552'
        ];

        $rule = 'app\common\validate\User';

        $res = $this->validate($data, $rule);
        echo $res ? '验证通过' : $res;
    }

    public function test2(){
        $user = \app\common\model\User::get(1);
        dump($user);
    }
}